<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cookie，document.cookie</title>
</head>
<body>
    <a href="https://zh.javascript.info/cookie">cookie</a>

    <script>
        // 设置 cookie
        document.cookie = "user=John";  // 只会更新名称为 user 的 cookie

        // document.cookie 获取页面中所有 cookie 以; 分隔 每一个都是独立的 cookie
        console.log(document.cookie);
    </script>
</body>
</html>